Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@babel/plugin-transform-flow-strip-types
Advanced tools
Strip flow type annotations from your output code.
The @babel/plugin-transform-flow-strip-types npm package is a plugin for Babel, a JavaScript compiler, that removes type annotations from Flow, a static type checker for JavaScript. This allows developers to write type-safe code during development and strip out these annotations for production builds, resulting in clean JavaScript that can be executed in environments that do not support Flow.
Stripping Flow Type Annotations
This feature removes Flow type annotations from your JavaScript files, converting typed code into plain JavaScript. The code sample shows a function with Flow types that are stripped out after transformation.
import { foo } from 'bar';
function square(n: number): number {
return n * n;
}
// Transformed to:
import { foo } from 'bar';
function square(n) {
return n * n;
}
Similar to @babel/plugin-transform-flow-strip-types, this Babel plugin strips TypeScript annotations from the code. While both plugins serve a similar purpose of removing type annotations, they cater to different type systems: Flow for the former and TypeScript for the latter.
This plugin also deals with Flow types but instead of stripping them, it converts them into comments. This can be useful for preserving type annotations in the transpiled output without affecting the runtime behavior.
Strip flow type annotations from your output code.
See our website @babel/plugin-transform-flow-strip-types for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-flow-strip-types
or using yarn:
yarn add @babel/plugin-transform-flow-strip-types --dev
v7.26.5 (2025-01-10)
babel-parser
import.defer()
form of import defer
(@babel-bot)babel-plugin-transform-block-scoped-functions
isInStrictMode
in Babel 7 (@liuxingbaoyu)babel-plugin-transform-typescript
babel-parser
@(a.b)()
(@liuxingbaoyu)babel-generator
, babel-parser
, babel-plugin-transform-flow-strip-types
, babel-types
babel-compat-data
, babel-preset-env
transform-typeof-symbol
compat data (@liuxingbaoyu)babel-generator
, babel-parser
, babel-types
babel-plugin-transform-nullish-coalescing-operator
FAQs
Strip flow type annotations from your output code.
The npm package @babel/plugin-transform-flow-strip-types receives a total of 11,971,186 weekly downloads. As such, @babel/plugin-transform-flow-strip-types popularity was classified as popular.
We found that @babel/plugin-transform-flow-strip-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.